<?php
namespace app\index\Validate;
use think\Validate;

class User extends Validate{

    //验证规则
    protected $rule = [
        'us_username'  =>'max:30',
        'us_qq'        =>'number|min:5',
        'us_wx'        =>'alphaNum',
        'us_phone'     => 'require',
        'us_id'        => 'require|integer',
        'us_sex'       =>'require|number',
        'us_phone_status' => 'require|number',
        'us_school'    => 'require'
    ];

    protected $message  =  [
        'us_username.max'        => '昵称长度超过限制',
        'us_qq.number'           => 'QQ号格式不正确',
        'us_qq.min'              => 'QQ号不能低于5位',
        'us_wx.alphaNum'         => '微信号格式不正确',
        'us_phone.require'       => '手机号必需填写',
        'us_id.require'          => '用户id缺失',
        'us_id.integer'          => '非法用户id',
        'us_sex.require'         => '性别不能为空',
        'us_sex.number'          => '性别类型错误',
        'us_phone_status.require'=> '手机号状态必填',
        'us_phone_status.number' => '手机号状态类型错误',
        'us_school.require'      => '学校必须选择'
    ];


}